const path = require('path');
const WebpackDevServer = require('webpack-dev-server');
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
    mode: "development",
    entry: {
        main:"./src/main.js"
    },
    output: {
        filename: "[name].[contentHash:10].js",
        path: path.resolve(__dirname, "dist")
    },
    module: {
        rules: []
    },
    plugins: [
        new HtmlWebpackPlugin({
            title:"webpack学习",
            template:"./public/index.html",
            filename:""
        })
    ],
    resolve:{
      src:"@"
    },
    devServer: {
        static: {
            directory: path.join(__dirname, "public"),
        },
        compress:false,
        port:9000
    }
}
